Skip to content

feat: keep yt-dlp current, harden downloads, fix notification & photo handling#206

Merged
GraysonCAdams merged 2 commits into
mainfrom
feat/ytdlp-hardening
Jul 8, 2026
Merged

feat: keep yt-dlp current, harden downloads, fix notification & photo handling#206
GraysonCAdams merged 2 commits into
mainfrom
feat/ytdlp-hardening

Conversation

@GraysonCAdams

Copy link
Copy Markdown
Collaborator

Why

Instagram video downloads were failing group-wide. Root cause: the yt-dlp provider binary lives in a persistent volume and was only ever downloaded once, so it froze at 2026.02.21 while Instagram changed its internals. On top of that, failed downloads were pushing false "X added a video" notifications, and photo posts (Scrolly is video-only) were left as opaque failures.

What

Keep yt-dlp current + hardened (a2bc3c8)

  • Track the nightly release channel (extractor fixes land there first) and self-update the binary on boot (if stale) and weekly via the scheduler. This is the actual fix for the freeze.
  • Add YTDLP_COOKIES_FILE so login-gated / audience-restricted Instagram posts download with an authenticated session (--cookies on all yt-dlp calls).
  • Modern format selection (bv*+ba/b) so split-DASH sources (Instagram) merge correctly, plus retry parity for video downloads (matching audio).
  • Surface yt-dlp version + staleness in /api/health and the provider list, so a frozen binary is visible instead of silently rotting.
  • Move pure version/caption helpers to a leaf module to break the provider/registry import cycle.

Download-pipeline fixes (3e759b2)

  • Notify only on genuine ready — failures/queued/no-provider/size-reject no longer push a false "added a video".
  • Reject confirmed non-video (photo) shares with a clear reason instead of an opaque failure.

Test plan

  • npm run check — clean
  • npm test — 529/529 passing (adds ytdlp version-helper tests + download-notify notification/rejection tests)
  • npm run build — succeeds (adapter-node)
  • Verified on the live instance: current yt-dlp downloads the previously-failing reels; the no-video signature reliably identifies photo posts

The yt-dlp provider binary lives in a persistent volume and was only ever
downloaded once, so it froze at whatever version was first installed and
Instagram extraction broke as the site changed. Keep it fresh and resilient:

- Track the nightly release channel (extractor fixes land there first) and
  self-update the binary on boot (if stale) and weekly via the scheduler.
- Add YTDLP_COOKIES_FILE support so login-gated / audience-restricted posts
  download with an authenticated session (--cookies on all yt-dlp calls).
- Modern format selection (bv*+ba/b) so split-DASH sources (Instagram) merge
  correctly, plus retry parity for video downloads (matching audio).
- Surface the installed version + staleness in /api/health and the provider
  list so a frozen binary is visible instead of silently rotting.
- Move the pure version/caption helpers into a leaf module to break the
  provider/registry import cycle; unit-tested in isolation.
Two download-pipeline corrections:

- The group was notified on every download outcome, including failures ("Still
  notify — viewable via external link"), so a failed clip pushed a false "X
  added a video". Notify only when a clip reaches genuine ready (uploaded and
  viewable); setClipReady's ready branch and publishQueuedClip already do this.
- Scrolly is video-only, but photo/carousel shares were left as opaque failures.
  Detect yt-dlp's confirmed no-video signature and reject with a clear reason
  ("Not a video — Scrolly only supports video posts"). No notification.
@GraysonCAdams
GraysonCAdams merged commit e8f1255 into main Jul 8, 2026
20 of 23 checks passed
@GraysonCAdams
GraysonCAdams deleted the feat/ytdlp-hardening branch July 8, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants